Skip to content

feat(redis): Eliminate runtime-generated redis-session.ini#2550

Draft
joshtrichards wants to merge 6 commits intomasterfrom
jtr/feat-redis-session-env-pure
Draft

feat(redis): Eliminate runtime-generated redis-session.ini#2550
joshtrichards wants to merge 6 commits intomasterfrom
jtr/feat-redis-session-env-pure

Conversation

@joshtrichards
Copy link
Copy Markdown
Member

@joshtrichards joshtrichards commented Mar 23, 2026

Fixes #763

  • avoids stale redis-session.ini
  • reduces mutable filesystem state
  • makes PHP config more declearative
  • aligns Redis PHP session config with the existing env-substitution pattner already used for other PHP settings like PHP_MEMORY_LIMIT
  • eliminates incompatibility of Redis session handler configuration with "rootless" scenarios (Introduced redis session handler does not work with non-root images #763)

Requirements:

  • Existing container-level REDIS_* image configuration variables remain as they exist today
  • Redis is enabled only when configured

For standard environments (i.e. those that already work today with the existing implementation), the result should be:

  • No change

For environments running containers w/o root:

  • They should start working (i.e. using the specified REDIS_HOST as the PHP session handler... instead of generating an error about being unable to write to the ini file and falling back on file-based session storage)

This is a prototype in its current state.

Key things to confirm:

  • What happens when the env vars are unset?

P.S. If the empty values being always passed through is problematic.... This tests the full “drop redis-session.ini entirely” idea. If this runs into challenges, we could generate a separate ini file (only when Redis is configured) in the entrypoint, but still source values from env. That would test the env-based composition separately from the fallback problem.

Signed-off-by: Josh <josh.t.richards@gmail.com>
Fixes #763 

Implements part I of #763 (comment)

Signed-off-by: Josh <josh.t.richards@gmail.com>
Signed-off-by: Josh <josh.t.richards@gmail.com>
Signed-off-by: Josh <josh.t.richards@gmail.com>
@joshtrichards joshtrichards added 2. developing feature: auto config (environment variables) Auto configuring via environment variables rootless Running in Docker w/o root enhancement labels Mar 23, 2026
@joshtrichards joshtrichards changed the title feat(php): configure Redis session handling via environment variables feat(redis): Eliminate runtime-generated redis-session.ini Mar 23, 2026
Signed-off-by: Josh <josh.t.richards@gmail.com>
@joshtrichards
Copy link
Copy Markdown
Member Author

@copilot resolve the merge conflicts in this pull request

…ion-env-pure

# Conflicts:
#	docker-entrypoint.sh

Co-authored-by: joshtrichards <1731941+joshtrichards@users.noreply.github.com>
Copy link
Copy Markdown

Copilot AI commented Apr 25, 2026

@copilot resolve the merge conflicts in this pull request

Merge conflicts resolved in fb923ef. The only conflicted file was docker-entrypoint.sh:

  1. Kept get_enabled_apps() from master (re-introduced in fix(entrypoint): compare enabled app names to report disabled apps after upgrade #2554 to fix false positives in disabled-app reporting during upgrades)
  2. Kept our env variable exports in configure_redis_session() over master's ini file writing approach (that's the feature this PR implements)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

2. developing enhancement feature: auto config (environment variables) Auto configuring via environment variables rootless Running in Docker w/o root

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Introduced redis session handler does not work with non-root images

2 participants